package com.ballyza.gals;

import java.util.HashMap;
import java.util.Map;

import com.ballyza.gals.Constants;

public class TokenNames {

	private final static Map<Integer, String> names = new HashMap<Integer, String>();
	
	private static void create() {
		names.put(Constants.t_identificador, "identificador");
		names.put(Constants.t_constante_real, "constante real");
		names.put(Constants.t_constante_inteira, "constante inteira");
		//names.put(Constants.t_read, "constante inteira");
		names.put(Constants.t_constante_literal, "constante literal");
		names.put(Constants.t_constante_data, "constante data");
		names.put(Constants.t_constante_hora, "constante hora");
	}
	
	private TokenNames() {}
	
	public final static String get(Integer tokenId) {
		if(tokenId >= Constants.t_TOKEN_2 && tokenId <= Constants.t_TOKEN_25)
			return "símbolo especial";
		else if(tokenId >= Constants.t_begin && tokenId <= Constants.t_write)
			return "palavra reservada";
	
		if(names.isEmpty())
			create();
		
		return names.get(tokenId);
	}
	
}